package com.kaili.basic.service.impl;

import com.baomidou.mybatisplus.plugins.Page;
import com.kaili.basic.pojo.dto.BaseLogQueryDto;
import com.kaili.basic.pojo.entity.BaseLog;
import com.kaili.basic.pojo.entity.BaseLogExport;
import com.kaili.basic.mapper.BaseLogMapper;
import com.kaili.basic.service.BaseLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
import java.util.Map;

/**
 * Created by renzhikun on 18-6-14.
 */
@Service
@Transactional
public class BaseLogServiceImpl implements BaseLogService {

    @Autowired
    private BaseLogMapper baseLogMapper;

    @Override
    public void addBaseLog(BaseLog baseLog) {
        baseLogMapper.addBaseLog(baseLog);
    }

    @Override
    public void deleteBaseLog(Long logId) {
        baseLogMapper.deleteBaseLog(logId);
    }

    @Override
    public void updateBaseLog(BaseLog baseLog) {
        baseLogMapper.updateBaseLog(baseLog);
    }

    @Override
    public Page<BaseLog> queryLogByEwbNo(Page<BaseLog> page, BaseLogQueryDto dto) {
        List<BaseLog> baseLogs = baseLogMapper.queryLogByEwbNo(page,dto);
        return page.setRecords(baseLogs);
    }

    @Override
    public List<BaseLogExport> queryLogExport(Map<String, Object> map) {
        return baseLogMapper.queryLogExport(map);
    }
}
